using System;
using System.Diagnostics;

namespace Think.Problems.Solitaire
{
    [DebuggerDisplay("Draw ({Value})")]
    public class DrawAction : Action
    {
        /// <summary>
        /// Inherent value of this action.
        /// </summary>
        public override double Value
        {
            get { return 1.1; }
        }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        public override string ToString()
        {
            return String.Format("Draw ({0})", Value);
        }
    }

    [DebuggerDisplay("Recycle ({Value})")]
    public class RecycleAction : Action
    {
        /// <summary>
        /// Inherent value of this action.
        /// </summary>
        public override double Value
        {
            get { return 1.1; }
        }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        public override string ToString()
        {
            return String.Format("Recycle ({0})", Value);
        }
    }

    [DebuggerDisplay("Flip ({Value}, Tableau={Tableau})")]
    public class FlipAction : Action
    {
        public int Tableau { get; set; }

        /// <summary>
        /// Inherent value of this action.
        /// </summary>
        public override double Value
        {
            get { return 2; }
        }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        public override string ToString()
        {
            return String.Format("Flip ({0}, Tableau={1})", Value, Tableau);
        }
    }

    [DebuggerDisplay("Move ({Value}, From={From}, To={To}, Index={Index})")]
    public class MoveAction : Action
    {
        public int From { get; set; }
        public int To { get; set; }
        public int Split { get; set; }

        /// <summary>
        /// Inherent value of this action.
        /// </summary>
        public override double Value
        {
            get { return 1 + Boost; }
        }

        public double Boost { get; set; }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        public override string ToString()
        {
            return String.Format("Move ({0}, From={1}, To={2}, Index={3})", Value, From, To, Split);
        }
    }

    [DebuggerDisplay("Return ({Value}, Tableau={Tableau}, Foundation={Foundation})")]
    public class ReturnAction : Action
    {
        public int Tableau { get; set; }
        public int Foundation { get; set; }

        /// <summary>
        /// Inherent value of this action.
        /// </summary>
        public override double Value
        {
            get { return 10; }
        }

        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>
        /// A string that represents the current object.
        /// </returns>
        public override string ToString()
        {
            return String.Format("Return ({0}, Tableau={1}, Foundation={2})", Value, Tableau, Foundation);
        }
    }
}